package org.fuxia.im.core;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExecutorDemo
{

	static class MyThread implements Runnable
	{

		public void run()
		{
			try
			{
				Thread.sleep(2000);
			}
			catch (InterruptedException e)
			{
				e.printStackTrace();
			}
			System.out.println(Thread.currentThread().getName() + "正在执行");
		}

	}

	public static void main(String[] args)
	{
		ExecutorService s = Executors.newCachedThreadPool();
		s.execute(new MyThread());
		s.execute(new MyThread());
		System.out.println(" --------------shut down thread-----------");
		s.shutdown();
	}

}
